<template>
  <a-tabs @change="changeTab" v-model="activeKey" class="app-group-tabs">
    <a-tab-pane :tab="$t('m.eform.apptable.entity.dataModel')" key="1">
      <ActAppTableTab :groupId="groupId" v-if="activeKey == '1'"></ActAppTableTab>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.formModel')" key="2">
      <ActAppFormTab :groupId="groupId" v-if="activeKey == '2'"></ActAppFormTab>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.flowModel')" key="3">
      <ProcessDefList :groupId="groupId" v-if="activeKey == '3'"></ProcessDefList>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.reportModel')" key="4">
      <ActAppReportTab :groupId="groupId" v-if="activeKey == '4'"></ActAppReportTab>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.viewModel')" key="5">
      <ActAppViewList :groupId="groupId" v-if="activeKey == '5'"></ActAppViewList>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.dictModel')" key="6">
      <dict-list :categoryType="'2'" :groupId="groupId" v-if="activeKey == '6'"></dict-list>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.menuModel')" key="7">
      <act-app-permission-list :category="'2'" :groupId="groupId" v-if="activeKey == '7'"></act-app-permission-list>
    </a-tab-pane>
    <a-tab-pane :tab="$t('m.eform.apptable.entity.languagesModel')" key="8" v-if="lang_enable">
      <locale-manager :groupId="groupId" v-if="activeKey == '8'"></locale-manager>
    </a-tab-pane>
    <a-button slot="tabBarExtraContent" type="primary" @click="toBack">
      {{ $t('m.common.button.back') }}
    </a-button>
  </a-tabs>
</template>

<script>

  import ActAppTableTab from './ActAppTableTab'
  import ActAppFormTab from './ActAppFormTab'
  import ActAppReportTab from './ActAppReportTab'
  import ProcessDefList from '../bpm/ProcessDefList'
  import DictList from '../system/DictList'
  import ActAppPermissionList from './ActAppPermissionList'
  import ActAppViewList from './ActAppViewList'
  import LocaleManager from './localeProvider/manager/LocaleManager'

  export default {
    name: 'ActAppGroupTab',
    components: {
      ActAppTableTab,
      ActAppFormTab,
      ActAppViewList,
      ActAppReportTab,
      ProcessDefList,
      DictList,
      ActAppPermissionList,
      LocaleManager,
    },
    props: {
      groupId: String
    },
    data () {
      return {
        activeKey: '1',
        lang_enable: bootConfig[process.env.NODE_ENV].VUE_APP_LOCALE_ENABLE
      }
    },
    methods: {
      toBack () {
        this.$emit('toMain')
      },
      changeTab (activeKey) {
        this.activeKey = activeKey
      }
    },
  }
</script>
<style>
.app-group-tabs .ant-tabs-nav-scroll{
  margin-top: 10px;
}
</style>
